

<template>
  <el-form :model="ruleForm" ref="ruleForm" label-width="100px" label-position="right" class="demo-ruleForm">
  <el-form-item label="信息" style="background-color: black" >
    <el-input type="text" v-model="ruleForm.msg" autocomplete="off"></el-input>
    <el-form-item>
      <el-button type="primary" @click="submitForm">提交</el-button>
    </el-form-item>
  </el-form-item>
    <el-form-item>
      <el-input type="text" v-model="NewMsg" autocomplete="off"></el-input>
    </el-form-item>
  </el-form>
</template>
<script>
import axios from "axios";

export default {
  name: "ChatView",
  data(){
    return{
      ruleForm:{
        msg:''
      },
      NewMsg:[],
    }
  },
  methods:{
    submitForm(){
      axios.get('http://localhost:8080/applications/c1', {
        params: {
          msg: this.ruleForm.msg
        }
      })
          .then(response => {
            this.NewMsg=response.data.data.content;
            console.log(response.data.data)
          })
          .catch(error => {
            console.error('Error fetching accounts:', error);
          });
    }
  }
}


</script>

<style scoped>

</style>